package cn.nawang.ebeim.client.process;

import cn.nawang.ebeim.client.transfer.TransferObject;

import java.io.Serializable;
import java.util.List;

/**
 * 上传下载任务的持久化对象,可持久化到关系型数据库或文件
 * Created by GanJc on 2016/1/22.
 */
public class PersistentObject implements Serializable {

    private String name ;

    private List<TransferObject> objects ;

    private ProcessType type ;

    //传输完成数
    private int successFileNum ;

    //总共传输文件数
    private int totalFileNum ;

    private double rate ;

    public PersistentObject() {
    }

    public PersistentObject(String name, List<TransferObject> objects, ProcessType type,
                            int totalFileNum,int successFileNum,double rate) {
        this.name = name;
        this.objects = objects;
        this.type = type;
        this.totalFileNum = totalFileNum;
        this.successFileNum = successFileNum;
        this.rate = rate ;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<TransferObject> getObjects() {
        return objects;
    }

    public void setObjects(List<TransferObject> objects) {
        this.objects = objects;
    }

    public ProcessType getType() {
        return type;
    }

    public void setType(ProcessType type) {
        this.type = type;
    }

    public int getTotalFileNum() {
        return totalFileNum;
    }

    public void setTotalFileNum(int totalFileNum) {
        this.totalFileNum = totalFileNum;
    }

    public int getSuccessFileNum() {
        return successFileNum;
    }

    public void setSuccessFileNum(int successFileNum) {
        this.successFileNum = successFileNum;
    }

    public double getRate() {
        return rate;
    }

    public void setRate(double rate) {
        this.rate = rate;
    }

    @Override
    public String toString() {
        return "PersistentObject{" +
                "name='" + name + '\'' +
                ", objects=" + objects +
                ", type=" + type +
                ", successFileNum=" + successFileNum +
                ", totalFileNum=" + totalFileNum +
                ", rate='" + rate + '\'' +
                '}';
    }
}
